<div class="editor">
	<input type="hidden" name="pre_zizhu" value=""/>
	<input type="hidden" name="sid" value="<{$sid}>"/>
	<span>当前学生：</span><span><{$editorInfo.stname}></span><span>专业：</span><span><{$editorInfo.major}></span><span>班级：</span><span><{$editorInfo.class}></span>
</div>
<hr>
<div style="text-align: center">
	<p>
		<span>当前资助：</span>
		<select name="select_pre">
			<option>-----请选择-----</option>
			<option value="zizhu1">资助1</option>
			<option value="zizhu2">资助2</option>
			<option value="zizhu3">资助3</option>
			<option value="zizhu4">资助4</option>
			<option value="zizhu5">资助5</option>
		</select>
	</p>
    <hr>
	<p>
		<span>资料和申请递交时间:</span><input type="text" name="zldjsj" value=""/>
		<span>入库时间：</span><input type="text" name="time" value=""/>&nbsp;&nbsp;&nbsp;&nbsp;<span>入库等级：</span><input type="text" name="grade" value=""/>
	</p>
	<button class="btn btn-primary" name="submit_help">提交修改</button>
</div>
<table width="100%" border="0" cellspacing="1" cellpadding="0" style="margin-top: 10px;" class="table table-bordered table-hover table-striped shittable">
  <tr>
    <td width="15%" height="33" align="center" valign="middle">&nbsp;</td>
    <td width="25%" align="center" valign="middle">资料递交时间</td>
    <td width="31%" align="center" valign="middle">入库时间</td>
    <td width="20%" align="center" valign="middle">入库等级</td>
    <td width="9%" align="center" valign="middle">编辑</td>
    
  </tr>
  <tr style="display:<{$help.zizhu1_zldjsj|default='none'}>">
    <td height="41" align="center" valign="middle">资助1</td>
    <td align="center" valign="middle" id="zizhu1_zldjsj"><{$help.zizhu1_zldjsj}></td>
    <td align="center" valign="middle" id="zizhu1_time"><{$help.zizhu1_time}></td>
    <td align="center" valign="middle" id="zizhu1_grade"><{$help.zizhu1_grade}></td>
    <td align="center" valign="middle"><a name="editor" title="zizhu1">编辑</a></td>
  </tr>
  <tr style="display:<{$help.zizhu2_zldjsj|default='none'}>">
    <td height="41" align="center" valign="middle">资助2</td>
    <td align="center" valign="middle" id="zizhu2_zldjsj"><{$help.zizhu2_zldjsj}></td>
    <td align="center" valign="middle" id="zizhu2_time"><{$help.zizhu2_time}></td>
    <td align="center" valign="middle" id="zizhu2_grade"><{$help.zizhu2_grade}></td>
    <td align="center" valign="middle"><a name="editor" title="zizhu2">编辑</a></td>
  </tr>
  <tr style="display:<{$help.zizhu3_zldjsj|default='none'}>">
    <td height="41" align="center" valign="middle">资助3</td>
    <td align="center" valign="middle" id="zizhu3_zldjsj"><{$help.zizhu3_zldjsj}></td>
    <td align="center" valign="middle" id="zizhu3_time"><{$help.zizhu3_time}></td>
    <td align="center" valign="middle" id="zizhu3_grade"><{$help.zizhu3_grade}></td>
    <td align="center" valign="middle"><a name="editor" title="zizhu3">编辑</a></td>
  </tr>
  <tr style="display:<{$help.zizhu4_zldjsj|default='none'}>">
    <td height="41" align="center" valign="middle">资助4</td>
    <td align="center" valign="middle" id="zizhu4_zldjsj"><{$help.zizhu4_zldjsj}></td>
    <td align="center" valign="middle" id="zizhu4_time"><{$help.zizhu4_time}></td>
    <td align="center" valign="middle" id="zizhu4_grade"><{$help.zizhu4_grade}></td>
    <td align="center" valign="middle"><a name="editor" title="zizhu4">编辑</a></td>
  </tr>
  <tr style="display:<{$help.zizhu5_zldjsj|default='none'}>">
    <td height="41" align="center" valign="middle">资助5</td>
    <td align="center" valign="middle" id="zizhu5_zldjsj"><{$help.zizhu5_zldjsj}></td>
    <td align="center" valign="middle" id="zizhu5_time"><{$help.zizhu5_time}></td>
    <td align="center" valign="middle" id="zizhu5_grade"><{$help.zizhu5_grade}></td>
    <td align="center" valign="middle"><a name="editor" title="zizhu5">编辑</a></td>
  </tr>

</table>

<script>
	var submit_help=document.getElementsByName("submit_help")[0];
	var editor=document.getElementsByName("editor");
	var zldjsj=document.getElementsByName("zldjsj")[0];
	var time=document.getElementsByName("time")[0];
	var grade=document.getElementsByName("grade")[0];
	var pre_zizhu=document.getElementsByName("pre_zizhu")[0];
	var sid=document.getElementsByName("sid")[0];
	var select_pre=document.getElementsByName("select_pre")[0];
	var help=new PureAjax();
	submit_help.onclick=function(){
		help.post({
			dataType:"text",
			data:{
				sid:sid.value,
				zldjsj:zldjsj.value,
				time:time.value,
				grade:grade.value,
				pre:pre_zizhu.value,
				submit:"yes"
			},
			url:URL+"Editor/createNewHelp/sid/"+sid.value,
			success:function(data){
				alert(data);
			}
		});
	}
	select_pre.onchange=function(){
		editorInfo(select_pre.options[select_pre.options.selectedIndex].value);
	}
	for(var j=0;j<5;j++){
		editor[j].onclick=function(){
			editorInfo(this.title);
		}
	}
	function editorInfo(title){
		switch(title){
			case "zizhu1":
				zldjsj.value=document.getElementById("zizhu1_zldjsj").innerHTML;
				time.value=document.getElementById("zizhu1_time").innerHTML;
				grade.value=document.getElementById("zizhu1_grade").innerHTML;
				pre_zizhu.value="zizhu1";
				select_pre.options[1].selected=true;
				break;
			case "zizhu2":
				zldjsj.value=document.getElementById("zizhu2_zldjsj").innerHTML;
				time.value=document.getElementById("zizhu2_time").innerHTML;
				grade.value=document.getElementById("zizhu2_grade").innerHTML;
				pre_zizhu.value="zizhu2";
				select_pre.options[2].selected=true;
				break;
			case "zizhu3":
				zldjsj.value=document.getElementById("zizhu3_zldjsj").innerHTML;
				time.value=document.getElementById("zizhu3_time").innerHTML;
				grade.value=document.getElementById("zizhu3_grade").innerHTML;
				pre_zizhu.value="zizhu3";
				select_pre.options[3].selected=true;
				break;
			case "zizhu4":
				zldjsj.value=document.getElementById("zizhu4_zldjsj").innerHTML;
				time.value=document.getElementById("zizhu4_time").innerHTML;
				grade.value=document.getElementById("zizhu4_grade").innerHTML;
				pre_zizhu.value="zizhu4";
				select_pre.options[4].selected=true;
				break;
			case "zizhu5":
				zldjsj.value=document.getElementById("zizhu5_zldjsj").innerHTML;
				time.value=document.getElementById("zizhu5_time").innerHTML;
				grade.value=document.getElementById("zizhu5_grade").innerHTML;
				pre_zizhu.value="zizhu5";
				select_pre.options[5].selected=true;
				break;
		}
	}
</script>